﻿@model PescarShop_1.Controllers.ProductoForm

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_LayoutAdministrador.cshtml";

}

<h2>Create</h2>

@using (Html.BeginForm("Create", "Productos", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Producto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.MarcaID, "Marca")
        </div>
        <div class="editor-field">
            @*@Html.DropDownList("MarcaID")*@
@*            @Html.ValidationMessageFor(model => model.MarcaID)*@

            <select id="MarcaID" name="MarcaID"> 
                @using (var db = new PescarShop_1.Models.ShopContext())
                { 
                    foreach (var mar in db.marcas) { 
                    <option value="@mar.MarcaID">@mar.Nombre</option> 
                    } 
                } 
            </select>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Modelo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Modelo)
            @Html.ValidationMessageFor(model => model.Modelo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Precio)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Precio)
            @Html.ValidationMessageFor(model => model.Precio)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Descripcion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descripcion)
            @Html.ValidationMessageFor(model => model.Descripcion)
        </div>

        <div class="editor-label">
            Foto
        </div>
        

        <div class="editor-field"> 
<input type="file" name="archivo" id="archivo" /> 

@* @Html.EditorFor(model => model.Foto) 
@Html.ValidationMessageFor(model => model.Foto)*@ 
</div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
